package com.maxjay.component.metadata.model;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

/**
 * 实体对象配置
 * 
 * @author zhaixm
 *
 */
public class EntityConfig implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	protected ViewConfig viewConfig;
	
	public EntityConfig() {
	}
	
	public ViewConfig getViewConfig() {
		return viewConfig;
	}

	public void setViewConfig(ViewConfig viewConfig) {
		this.viewConfig = viewConfig;
	}

	/**
	 * 视图配置
	 * 
	 * @author zhaixm
	 *
	 */
	public class ViewConfig implements Serializable {
		
		/**
		 * 
		 */
		private static final long serialVersionUID = -1489457357493039866L;

		/**
		 * 新增页面地址
		 */
		private String createPageLocation = "/component/metadata/addEntity.jsp";
		
		/**
		 * 更新页面地址
		 */
		private String updatePageLocation = "/component/metadata/editEntity.jsp";
		
		/**
		 * 实体页面JS插件
		 */
		private String entityPluginScript = "";
		
		public ViewConfig() {
		}
		
		public ViewConfig(String createPageLocation, String updatePageLocation) {
			super();
			if(StringUtils.isNotBlank(createPageLocation)) {
				this.createPageLocation = createPageLocation;
			}
			if(StringUtils.isNotBlank(updatePageLocation)) {
				this.updatePageLocation = updatePageLocation;
			}
		}

		public String getCreatePageLocation() {
			return createPageLocation;
		}

		public void setCreatePageLocation(String createPageLocation) {
			if(StringUtils.isNotBlank(createPageLocation)) {
				this.createPageLocation = createPageLocation;
			}
		}

		public String getUpdatePageLocation() {
			return updatePageLocation;
		}

		public void setUpdatePageLocation(String updatePageLocation) {
			if(StringUtils.isNotBlank(updatePageLocation)) {
				this.updatePageLocation = updatePageLocation;
			}
		}

		public String getEntityPluginScript() {
			return entityPluginScript;
		}

		public void setEntityPluginScript(String entityPluginScript) {
			if(StringUtils.isNotBlank(entityPluginScript)) {
				this.entityPluginScript = entityPluginScript;
			}
		}

	}

}
